package com.ruoyi.integration.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotBlank;

@Data
@Configuration
@Component
@ConfigurationProperties(prefix = "thirdparty.inversion-service")
public class InversionServiceProperties {

    private Endpoint  endpoint = new Endpoint();
    private ApiRouter apiRouter = new ApiRouter();

    @Data
    public static class Endpoint {
        /**
         * 对应 yaml: thirdparty.inversion-service.endpoint.base-url
         * 注意：yaml 中的 base-url 会自动绑定到 baseUrl
         */
        @NotBlank
        private String baseUrl;
    }

    @Data
    public static class ApiRouter {
        /**
         * 对应 yaml: thirdparty.inversion-service.api-router.geoserver-release
         * hyphen -> 驼峰：geoserver-release -> geoserverRelease
         */
        @NotBlank
        private String geoserverRelease;

        /**
         * 对应 yaml: thirdparty.inversion-service.api-router.inverse
         */
        @NotBlank
        private String inverse;

        /**
         * 对应 yaml: thirdparty.inversion-service.api-router.rclone
         */
        @NotBlank
        private String rclone;
    }
}

